<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/news.css" />
    <link rel="stylesheet" type="text/css" href="../../css/tuiguang.css" />
    <link rel="stylesheet" href="../../css/mobile_select.css">
</head>

<body>
    <div id="view" v-cloak>
<div style="width: 91%;height: 30px;margin: 0 auto;">
<img src="../../image/icon/baobiao.png" style="float: left;width: 30px;height: 30px;"><span style="float: left;line-height: 30px;">数据报表</span>

<div id="select_2" style="float: right;line-height: 30px;">日期：{{today}}</div>
</div>
<div style="width: 91%;margin: 20px auto;font-size: 90%;">
    <div style="width: 100%;height: 30px;line-height: 30px;">
    <div style="width: 50%;float: left;color:orange;">当日收益(钻石)</div>
    <div style="width: 50%;float: right;">{{ffList.shouyi}}</div>
    </div>
    <div style="width: 100%;height: 30px;line-height: 30px;">
        <div style="width: 50%;float: left;">视频时长(分钟)</div>
        <div style="width: 50%;float: right;">{{ffList.video}}</div>
    </div>
    <div style="width: 100%;height: 30px;line-height: 30px;">
        <div style="width: 50%;float: left;">通话时长(分钟)</div>
        <div style="width: 50%;float: right;">{{ffList.sound}}</div>
    </div>
    <div style="width: 100%;height: 30px;line-height: 30px;">
        <div style="width: 50%;float: left;">互动人数</div>
        <div style="width: 50%;float: right;">{{ffList.hudong}}</div>
    </div>
</div>


    </div>

</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/ffkj.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript" src="../../script/mobile_select.js"></script>
<script type="text/javascript" src="../../script/select_date.js"></script>
<script type="text/javascript">
    var view = new Vue({
        el: '#view',
        data: {
            ffList: {"shouyi":0,"video":0,"sound":0,"hudong":0},
            today:''
        }
    });
    var nowDate = new Date();
    var nowYear = nowDate.getFullYear();
    var nowMon = nowDate.getMonth()+1;
    var nowDay = nowDate.getDate();
    apiready = function() {
        if(!view.today){
        view.today=nowYear+'-'+nowMon+'-'+nowDay
        }
        view.types=api.pageParam['types']
        var param = {
            user_id: $api.getStorage('userid'),
            types: api.pageParam['types'],
            today:view.today
        };
        _shangla(function() {
            param.today=view.today
            list(1, 1, param);
        })

        // _scrollToBottom(function() {
        //     param.today=view.today
        //     if (heigutgao == 1) {
        //         pagenum++;
        //         _lists('api/user/incomeLists', pagenum, '', param);
        //     }
        // })

        
    }
    
   
    /*默认全部参数*/
    $.selectDate("#select_2", {
        start: nowYear - 5,
        end: nowYear ,
        select: [nowYear, nowMon , nowDay],
        title: '请选择生日'
    }, function(data) {
        console.log(JSON.stringify(data));
        view.today=data.year+'-'+data.month+'-'+data.day
        count()
    });
    function count() {
        var param = {
            user_id: $api.getStorage('userid'),
            types: view.types,
            today:view.today
        };
        list(1, 1, param);
    }
    function list(page, loading, data){
        data.pagecount = 10;
        data.pagesize = 10;
        data.page = page;
        pagenum = page;


        _ajax('api/user/incomeLists', function(ret, err) {
        console.log(JSON.stringify(ret))
        console.log(JSON.stringify(err))
        ret = ret.ret ? ret.ret : ret;
        if (ret) {
            if (loading == 1) { // 上拉刷新时  初始化参数
                api.refreshHeaderLoadDone();
                view.ffList = {"shouyi":0,"video":0,"sound":0,"hudong":0};
            }
            view.ffList=ret.data
            

        } else {
            view.ffList = {"shouyi":0,"video":0,"sound":0,"hudong":0};
            api.refreshHeaderLoadDone();
        }
    }, data)
    setTimeout(function() {
        _loadingClose();
    }, 300)

  
    }

</script>

</html>